package thinkingJava.chapter13;

import java.util.Arrays;

public class Splitting {
	public static String knights = "" +
			"Then, today is so fun,at noon,I went to the yonganli station to rechange the foot" +
			" which is too bigger for me to use,so I went there to rechange them";
	public static void split(String regex) {
		System.out.println(
				Arrays.toString(knights.split(regex))
		);
	}
	public static void split(String regex, int count) {
		System.out.println(
				Arrays.toString( knights.split(regex, count))
		);
	}
	public static void main(String[] args) {
		split(" ");
		split("\\W+");
		split("n\\W+");
		split("\\W+",1);
	}
}
